package com.example.mq.expend;

import com.rabbitmq.client.Channel;
import com.weixin.common.core.constant.RabbitConstants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消息接收者
 * 消息消费者
 *
 * @author rosszhang
 */
@Component
public class ExpendReceiver {

    /**
     * 接收消息的方法。采用消息队列监听机制
     *
     * @param msg
     */
    // @RabbitListener(queues = RabbitConstants.QUEUE_NAME)
    // public void process(String msg, Channel channel, Message message) {
    //     System.out.println("消息消费者：" + msg);
    //     System.out.println("消费者1channel通道编号为：" + channel.getChannelNumber());
    //     System.out.println("消费者1收到消息：" + new String(message.getBody()));
    // }
}